﻿window.store = Framework7.createStore({
    state: {
        user: {},
        todayFilter: null,
        permission: [],
        reportId: '',
        examId: '',
        report:'',
        revokeTitle: '',
        exam: {} // 报告详情页面打开检查详情弹窗窗
    },
    actions: {
        helloWorld(ctx) {
            app.dialog.alert('Hello world');
        },
        loadUsers({ state }) {
            state.usersLoading = true;
            setTimeout(() => {
                state.usersLoading = false;
                state.users = ['Aaron', 'Alexander', 'Candy', 'Chloe', 'Vladimir'];
            }, 3000);
        },
    },
    getters: {
        todayFilter:({ state }) => {
            return state.todayFilter;
        },
        permissions:({ state }) => {
            return state.permission;
        },
        reportId: ({ state }) => {
            return state.reportId;
        },
        examId: ({ state }) => {
            return state.examId;
        },
        revokeTitle: ({ state }) => {
            return state.revokeTitle;
        },
        report: ({ state }) => {
            return state.report;
        },
        exam: ({ state }) => {
            return state.exam;
        }
    }
});
